﻿<%@ Page Language="C#" Title="局点管理" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Substation.aspx.cs" Inherits="Com.Crc.ResManage.Web.EquipManage.SUBSTATION.SUBSTATION" %>
<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.2, Version=7.2.20072.61, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <table>

        <tr>
            <td>
                <table>
                    <tr>
                        <td class="td_content">
                            <asp:Label ID="lblBranchOffice" runat="server" Text="所属分局" 
                                style="font-size:12px"></asp:Label>
                        </td>
                        <td class="td_little_margin"></td>
                        <td class="td_content">
                            <asp:DropDownList
                                ID="ddlBranchOffice" runat="server" Width="100px">
                            </asp:DropDownList>
                        </td>
                        <td class="td_large_margin"></td>
                        <td class="td_content">
                            <asp:Label ID="lblOffice" runat="server" Text="所属局点"
                                ></asp:Label>
                        </td>
                         <td class="td_little_margin"></td>
                        <td class="td_content">
                            <asp:DropDownList
                                ID="ddlOffice" runat="server" Width="100px">
                            </asp:DropDownList>
                        </td>
                        <td class="td_large_margin"></td>
                        <td class="td_content">
                            <asp:Button ID="btnQuery" runat="server" Text="查询" CssClass="inputbutton" 
                                onclick="btnQuery_Click"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <tr>
            <td>
                <igtbl:ultrawebgrid ID="grd" runat="server" OnInitializeLayout="grd_InitializeLayout"
                    OnPageIndexChanged="grd_PageIndexChanged" Height="0px" >
                    <DisplayLayout BorderCollapseDefault="NotSet" Name="gridxrole" RowHeightDefault="22px"
                        StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" AutoGenerateColumns="False"
                        SelectTypeRowDefault="Single" CellClickActionDefault="RowSelect" RowSelectorsDefault="No"
                        CellPaddingDefault="1" CellSpacingDefault="1" ScrollBar="Never">
                        <ClientSideEvents CellClickHandler="OnCellClick" />
                        <ActivationObject BorderWidth="" BorderColor="153, 153, 153">
                        </ActivationObject>
                        <RowStyleDefault BackColor="LightBlue" BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana"
                            Font-Size="8pt" BorderColor="#669999" ForeColor="#74776A">
                            <Padding Left="3px" />
                        </RowStyleDefault>
                        <EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
                        </EditCellStyleDefault>
                        <RowAlternateStyleDefault BackColor="BurlyWood">
                        </RowAlternateStyleDefault>
                        <FrameStyle BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana" Font-Size="8pt"
                            BorderColor="#354A54" Height="0px">
                            <BorderDetails StyleBottom="None" StyleLeft="None" StyleRight="None" StyleTop="None" />
                        </FrameStyle>
                        <HeaderStyleDefault BorderStyle="Solid" BorderWidth="0px" BorderColor="#354A54" Height="22px"
                            BackColor="#01212F" ForeColor="White">
                        </HeaderStyleDefault>
                        <Pager AllowPaging="True" PageSize="20" Pattern="&lt;table&gt;&lt;tr&gt;&lt;td align=right&gt;Per page:[pagesize] Page:[default]&lt;td&gt;&lt;/tr&gt;&lt;/table&gt; " StyleMode="PrevNext">
                        </Pager>
                    </DisplayLayout>
                    <Bands>
                        <igtbl:UltraGridBand >
                            <Columns>
                                <igtbl:UltraGridColumn >
                                    <Header Caption="Column 0">
                                    </Header>
                                </igtbl:UltraGridColumn>
                            </Columns>
                            <AddNewRow View="NotSet" Visible="NotSet">
                            </AddNewRow>
                        </igtbl:UltraGridBand>
                    </Bands>
                </igtbl:ultrawebgrid>
            </td>
         </tr>
         <tr>
            <td colspan=8>
            <table>
            <tr>
            <td>
                <asp:Button ID="btnAdd" runat="server" Text="新增" CssClass="inputbutton" />
            </td>
            <td>
                <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="inputbutton" 
                    onclick="btnDelete_Click" />
            </td>
            </tr>
            </table>
            </td>
        </tr>
    </table>

    <script type="text/javascript">
        function OpenAddWindow() {
            var strReturn = window.showModalDialog('AddSubstation.aspx?optype=1', '', 'dialogWidth:900px;dialogHeight:625px;center:yes;help:no;status:no;');
            if (strReturn != null) {

                return true;
            }
            return false;
        }

        function SelectAll(oGrid, checkbox) {
            var o = igtbl_getGridById(oGrid);
            var oRows = o.Rows;
            for (i = 0; i < oRows.length; i++) {
                (oRows.getRow(i).getCellFromKey("CHECK")).setValue(checkbox.checked);
            }
        }

        function OnCellClick(table, cell) {
            var cell = igtbl_getCellById(cell);
            if (cell == null) {
                return true;
            }
            else {
                if (cell.Column.Key == "Edit") {

                    var equipId = cell.Row.getCellFromKey("N_ID").getValue();
                    window.showModalDialog('AddSubstation.aspx?optype=0&equipid=' + equipId, '', 'dialogWidth:900px;dialogHeight:625px;center:yes;help:no;status:no;');

                    var refresh = document.getElementById("<%= this.btnQuery.ClientID %>");
                    refresh.click();

                    return false;
                }
            }

        }


    </script>


</asp:Content>